package com.example.tms.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.example.tms.tools.GlobalParam;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 司机信息
 */
@Table(name = "driver_info")
@Entity
@DynamicInsert
public class DriverInfo {
    @Id
    private String sjid;
    private String jsyxm;
    private String bumenid;
    private String gangwei;
    private String jsysj;
    private String sfzh;
    private String sfzszd;
    private String clid;
    private String yjscph;
    private String zzzt;
    private String htbh;
    private String htyxrq;
    private String czrq;
    private String beizhu;
    private String sfzfyj;

    private String jkzmzp;
    private String jszh;
    private String dah;
    private String jszfzjg;
    private String jszclrq;
    private String jszyxqz;
    private String jszfyj;
    private String cyzgzh;
    private String cyzgzfzjg;
    private String cyzgzclrq;
    private String cyzgzyxqz;
    private String cyzgzfyj;
    private String yyzh;
    private String yyzfzjg;
    private String yyzclrq;
    private String yyzyxqz;
    private String yyzfyj;
    private Boolean sfcz;
    private String jjlxrm;
    private String ywywgm;
    private String ywycb;
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date lasttime;

    private String sfzfm;
    private String sfzzm;
    private String sjsfzsbsz;
    private String jsznjrq;
    private String cyzgznjrq;
    private String jszzb;
    private String jszfb;
    private String cyzgz1;
    private String cyzgz2;
    private String cyzgz3;
    private String cyzgz4;
    private String cyzgz5;

    private String yhid;

    public DriverInfo(){}

    public DriverInfo(String sjid, String jsyxm,String sfzh,String jsysj,String zzzt,String bumenid){
        this.sjid = sjid;
        this.jsyxm = jsyxm;
        this.sfzh = sfzh;
        this.jsysj = jsysj;
        this.zzzt = zzzt;
        this.bumenid = bumenid;
        this.sfzfyj="";
        this.jkzmzp="";
        this.lasttime=GlobalParam.getTime();
        this.sfcz=true;
    }

    public static DriverInfo app(DriverInfo driverInfo,DriverApp driverApp){
        driverInfo.jsyxm = driverApp.getXingming();
        driverInfo.bumenid="";
        driverInfo.jsysj=driverApp.getSjhm();
        driverInfo.sfzh = driverApp.getSfzh();
        if (driverApp.getCun()!=null) {
            driverInfo.sfzszd = driverApp.getJiguan() + driverApp.getCun();
        }else {
            driverInfo.sfzszd = driverApp.getJiguan();
        }
        driverInfo.sfzfyj=driverApp.getSfzzm();
        driverInfo.sfzfm=driverApp.getSfzfm();
        driverInfo.sjsfzsbsz = driverApp.getSjsfzsbsz();
        driverInfo.jszfyj = driverApp.getJszzb();
        driverInfo.jszfb = driverApp.getJszfb();
        driverInfo.cyzgzfyj = driverApp.getCyzgz1();
        if(driverApp.getCyzgz2()!=null&&!driverApp.getCyzgz2().equals("")){
            driverInfo.cyzgz2 = driverApp.getCyzgz2();
        }
        if(driverApp.getCyzgz3()!=null&&!driverApp.getCyzgz3().equals("")){
            driverInfo.cyzgz3 = driverApp.getCyzgz3();
        }
        if(driverApp.getCyzgz4()!=null&&!driverApp.getCyzgz4().equals("")){
            driverInfo.cyzgz4 = driverApp.getCyzgz4();
        }
        if(driverApp.getCyzgz5()!=null&&!driverApp.getCyzgz5().equals("")){
            driverInfo.cyzgz5 = driverApp.getCyzgz5();
        }
        String cyzgznjrq = driverApp.getCyzgznjrq();
        String cyzgznjrq1 = cyzgznjrq.substring(0,10);
        driverInfo.cyzgznjrq=cyzgznjrq1;
        String jsznjrq = driverApp.getJsznjrq();
        String jsznjrq1 = jsznjrq.substring(0,10);
        driverInfo.jsznjrq=jsznjrq1;
        driverInfo.jkzmzp="";
        driverInfo.sfcz=false;
        driverInfo.lasttime=driverApp.getLasttime();
        driverInfo.jjlxrm="[]";
        return driverInfo;
    }

    @Override
    public String toString() {
        return "DriverInfo{" +
                "sjid='" + sjid + '\'' +
                ", jsyxm='" + jsyxm + '\'' +
                ", bumenid='" + bumenid + '\'' +
                ", gangwei='" + gangwei + '\'' +
                ", jsysj='" + jsysj + '\'' +
                ", sfzh='" + sfzh + '\'' +
                ", sfzszd='" + sfzszd + '\'' +
                ", clid='" + clid + '\'' +
                ", yjscph='" + yjscph + '\'' +
                ", zzzt='" + zzzt + '\'' +
                ", htbh='" + htbh + '\'' +
                ", htyxrq='" + htyxrq + '\'' +
                ", czrq='" + czrq + '\'' +
                ", beizhu='" + beizhu + '\'' +
                ", sfzfyj='" + sfzfyj + '\'' +
                ", jkzmzp='" + jkzmzp + '\'' +
                ", jszh='" + jszh + '\'' +
                ", dah='" + dah + '\'' +
                ", jszfzjg='" + jszfzjg + '\'' +
                ", jszclrq='" + jszclrq + '\'' +
                ", jszyxqz='" + jszyxqz + '\'' +
                ", jszfyj='" + jszfyj + '\'' +
                ", cyzgzh='" + cyzgzh + '\'' +
                ", cyzgzfzjg='" + cyzgzfzjg + '\'' +
                ", cyzgzclrq='" + cyzgzclrq + '\'' +
                ", cyzgzyxqz='" + cyzgzyxqz + '\'' +
                ", cyzgzfyj='" + cyzgzfyj + '\'' +
                ", yyzh='" + yyzh + '\'' +
                ", yyzfzjg='" + yyzfzjg + '\'' +
                ", yyzclrq='" + yyzclrq + '\'' +
                ", yyzyxqz='" + yyzyxqz + '\'' +
                ", yyzfyj='" + yyzfyj + '\'' +
                ", sfcz=" + sfcz +
                ", jjlxrm='" + jjlxrm + '\'' +
                ", ywywgm='" + ywywgm + '\'' +
                ", ywycb='" + ywycb + '\'' +
                ", lasttime=" + lasttime +
                ", sfzfm='" + sfzfm + '\'' +
                ", sfzzm='" + sfzzm + '\'' +
                ", sjsfzsbsz='" + sjsfzsbsz + '\'' +
                ", jsznjrq='" + jsznjrq + '\'' +
                ", cyzgznjrq='" + cyzgznjrq + '\'' +
                ", jszzb='" + jszzb + '\'' +
                ", jszfb='" + jszfb + '\'' +
                ", cyzgz1='" + cyzgz1 + '\'' +
                ", cyzgz2='" + cyzgz2 + '\'' +
                ", cyzgz3='" + cyzgz3 + '\'' +
                ", cyzgz4='" + cyzgz4 + '\'' +
                ", cyzgz5='" + cyzgz5 + '\'' +
                ", yhid='" + yhid + '\'' +
                '}';
    }

    public String getYhid() {
        return yhid;
    }

    public void setYhid(String yhid) {
        this.yhid = yhid;
    }

    public String getSfzfm() {
        return sfzfm;
    }

    public void setSfzfm(String sfzfm) {
        this.sfzfm = sfzfm;
    }

    public String getSfzzm() {
        return sfzzm;
    }

    public void setSfzzm(String sfzzm) {
        this.sfzzm = sfzzm;
    }

    public String getSjsfzsbsz() {
        return sjsfzsbsz;
    }

    public void setSjsfzsbsz(String sjsfzsbsz) {
        this.sjsfzsbsz = sjsfzsbsz;
    }

    public String getJsznjrq() {
        return jsznjrq;
    }

    public void setJsznjrq(String jsznjrq) {
        this.jsznjrq = jsznjrq;
    }

    public String getCyzgznjrq() {
        return cyzgznjrq;
    }

    public void setCyzgznjrq(String cyzgznjrq) {
        this.cyzgznjrq = cyzgznjrq;
    }

    public String getJszzb() {
        return jszzb;
    }

    public void setJszzb(String jszzb) {
        this.jszzb = jszzb;
    }

    public String getJszfb() {
        return jszfb;
    }

    public void setJszfb(String jszfb) {
        this.jszfb = jszfb;
    }

    public String getCyzgz1() {
        return cyzgz1;
    }

    public void setCyzgz1(String cyzgz1) {
        this.cyzgz1 = cyzgz1;
    }

    public String getCyzgz2() {
        return cyzgz2;
    }

    public void setCyzgz2(String cyzgz2) {
        this.cyzgz2 = cyzgz2;
    }

    public String getCyzgz3() {
        return cyzgz3;
    }

    public void setCyzgz3(String cyzgz3) {
        this.cyzgz3 = cyzgz3;
    }

    public String getCyzgz4() {
        return cyzgz4;
    }

    public void setCyzgz4(String cyzgz4) {
        this.cyzgz4 = cyzgz4;
    }

    public String getCyzgz5() {
        return cyzgz5;
    }

    public void setCyzgz5(String cyzgz5) {
        this.cyzgz5 = cyzgz5;
    }

    public String getYwywgm() {
        return ywywgm;
    }

    public void setYwywgm(String ywywgm) {
        this.ywywgm = ywywgm;
    }

    public String getYwycb() {
        return ywycb;
    }

    public void setYwycb(String ywycb) {
        this.ywycb = ywycb;
    }

    public String getJjlxrm() {
        return jjlxrm;
    }

    public void setJjlxrm(String jjlxrm) {
        this.jjlxrm = jjlxrm;
    }

    public String getJszfyj() {
        return jszfyj;
    }

    public void setJszfyj(String jszfyj) {
        this.jszfyj = jszfyj;
    }

    public String getSjid() {
        return sjid;
    }

    public void setSjid(String sjid) {
        this.sjid = sjid;
    }

    public String getJsyxm() {
        return jsyxm;
    }

    public void setJsyxm(String jsyxm) {
        this.jsyxm = jsyxm;
    }

    public String getBumenid() {
        return bumenid;
    }

    public void setBumenid(String bumenid) {
        this.bumenid = bumenid;
    }

    public String getGangwei() {
        return gangwei;
    }

    public void setGangwei(String gangwei) {
        this.gangwei = gangwei;
    }

    public String getJsysj() {
        return jsysj;
    }

    public void setJsysj(String jsysj) {
        this.jsysj = jsysj;
    }

    public String getSfzh() {
        return sfzh;
    }

    public void setSfzh(String sfzh) {
        this.sfzh = sfzh;
    }

    public String getSfzszd() {
        return sfzszd;
    }

    public void setSfzszd(String sfzszd) {
        this.sfzszd = sfzszd;
    }

    public String getClid() {
        return clid;
    }

    public void setClid(String clid) {
        this.clid = clid;
    }

    public String getYjscph() {
        return yjscph;
    }

    public void setYjscph(String yjscph) {
        this.yjscph = yjscph;
    }

    public String getZzzt() {
        return zzzt;
    }

    public void setZzzt(String zzzt) {
        this.zzzt = zzzt;
    }

    public String getHtbh() {
        return htbh;
    }

    public void setHtbh(String htbh) {
        this.htbh = htbh;
    }

    public void setBeizhu(String beizhu) {
        this.beizhu = beizhu;
    }

    public String getSfzfyj() {
        return sfzfyj;
    }

    public void setSfzfyj(String sfzfyj) {
        this.sfzfyj = sfzfyj;
    }

    public String getJkzmzp() {
        return jkzmzp;
    }

    public void setJkzmzp(String jkzmzp) {
        this.jkzmzp = jkzmzp;
    }

    public String getJszh() {
        return jszh;
    }

    public void setJszh(String jszh) {
        this.jszh = jszh;
    }

    public String getDah() {
        return dah;
    }

    public void setDah(String dah) {
        this.dah = dah;
    }

    public String getJszfzjg() {
        return jszfzjg;
    }

    public void setJszfzjg(String jszfzjg) {
        this.jszfzjg = jszfzjg;
    }

    public String getCyzgzh() {
        return cyzgzh;
    }

    public void setCyzgzh(String cyzgzh) {
        this.cyzgzh = cyzgzh;
    }

    public String getCyzgzfzjg() {
        return cyzgzfzjg;
    }

    public void setCyzgzfzjg(String cyzgzfzjg) {
        this.cyzgzfzjg = cyzgzfzjg;
    }

    public String getCyzgzfyj() {
        return cyzgzfyj;
    }

    public void setCyzgzfyj(String cyzgzfyj) {
        this.cyzgzfyj = cyzgzfyj;
    }

    public String getYyzh() {
        return yyzh;
    }

    public void setYyzh(String yyzh) {
        this.yyzh = yyzh;
    }

    public String getYyzfzjg() {
        return yyzfzjg;
    }

    public void setYyzfzjg(String yyzfzjg) {
        this.yyzfzjg = yyzfzjg;
    }

    public String getYyzfyj() {
        return yyzfyj;
    }

    public void setYyzfyj(String yyzfyj) {
        this.yyzfyj = yyzfyj;
    }

    public Boolean getSfcz() {
        return sfcz;
    }

    public void setSfcz(Boolean sfcz) {
        this.sfcz = sfcz;
    }

    public Date getLasttime() {
        return lasttime;
    }

    public void setLasttime(Date lasttime) {
        this.lasttime = lasttime;
    }

    public String getHtyxrq() {
        return htyxrq;
    }

    public void setHtyxrq(String htyxrq) {
        this.htyxrq = htyxrq;
    }

    public String getCzrq() {
        return czrq;
    }

    public void setCzrq(String czrq) {
        this.czrq = czrq;
    }

    public String getBeizhu() {
        return beizhu;
    }

    public String getJszclrq() {
        return jszclrq;
    }

    public void setJszclrq(String jszclrq) {
        this.jszclrq = jszclrq;
    }

    public String getJszyxqz() {
        return jszyxqz;
    }

    public void setJszyxqz(String jszyxqz) {
        this.jszyxqz = jszyxqz;
    }

    public String getCyzgzclrq() {
        return cyzgzclrq;
    }

    public void setCyzgzclrq(String cyzgzclrq) {
        this.cyzgzclrq = cyzgzclrq;
    }

    public String getCyzgzyxqz() {
        return cyzgzyxqz;
    }

    public void setCyzgzyxqz(String cyzgzyxqz) {
        this.cyzgzyxqz = cyzgzyxqz;
    }

    public String getYyzclrq() {
        return yyzclrq;
    }

    public void setYyzclrq(String yyzclrq) {
        this.yyzclrq = yyzclrq;
    }

    public String getYyzyxqz() {
        return yyzyxqz;
    }

    public void setYyzyxqz(String yyzyxqz) {
        this.yyzyxqz = yyzyxqz;
    }
}
